<section class="content-header">
    <h1>
        额定CT 配置
    </h1>
</section>

<!-- Main content -->
<section class="content">
    <div class="row">
        <div class="col-md-3 col-md-push-9">
            <div class="box box-default">
                <div class="box-header with-border">
                    <h3 class="box-title">查询区域</h3>
                    <div class="box-tools pull-right">
                        <button type="button" class="btn btn-box-tool" data-widget="collapse">
                            <i class="fa fa-minus"></i>
                        </button>
                    </div>
                </div>
                <div class="box-body">
                    <div class="form-group">
                        <label>区域</label>
                        <dx-drop-down-box #ddda style="width:100%;height:35px;margin-bottom:10px;border-radius: 0px"
                            [(value)]="subAreaSelected" displayExpr="subArea" placeholder="请选择区域" [showClearButton]="true"
                            (onValueChanged)="onSubAreaSelectedChange($event)" [dataSource]="subAreaItems">
                            <dxo-drop-down-options [height]="310"></dxo-drop-down-options>
                            <div *dxTemplate="let data of 'content'">
                                <button type="button" (click)="clearSubAreaSelected()" class="btn btn-default btn-sm"
                                    title="重置">重置</button>&nbsp;&nbsp;&nbsp;
                                <button type="button" (click)="subAreaSelectedOk()" class="btn btn-info btn-sm" title="确定">确定</button>
                                <dx-data-grid [dataSource]="subAreaItems" [hoverStateEnabled]="true" [paging]="{ enabled: true, pageSize: 1000 }"
                                    [filterRow]="{ visible: true }" [(selectedRowKeys)]="subAreaSelected" [scrolling]="{ mode: 'infinite' }"
                                    [height]="265" [showColumnLines]="true" [showRowLines]="true" [showBorders]="true"
                                    [rowAlternationEnabled]="true">
                                    <dxo-selection [selectAllMode]="allPages" [showCheckBoxesMode]="always" mode="multiple"></dxo-selection>
                                    <dxi-column dataField="subArea" caption="区域">
                                    </dxi-column>
                                </dx-data-grid>
                            </div>
                        </dx-drop-down-box>
                    </div>
                    <div class="form-group">
                        <label>工位</label>
                        <dx-drop-down-box #dddb style="width:100%;height:35px;margin-bottom:10px;border-radius: 0px" [(value)]="equipmentSelected"
                            displayExpr="stationCode" placeholder="请选择工位" [showClearButton]="true" [dataSource]="equipemntItems">
                            <dxo-drop-down-options [height]="310"></dxo-drop-down-options>
                            <div *dxTemplate="let data of 'content'">
                                <button type="button" (click)="clearEquipmentSelected()" class="btn btn-default btn-sm" title="重置">重置</button>&nbsp;&nbsp;&nbsp;
                                <button type="button" (click)="equipmentSelectedOk()" class="btn btn-info btn-sm" title="确定">确定</button>
                                <dx-data-grid #ddg [dataSource]="equipemntItems" [hoverStateEnabled]="true" [paging]="{ enabled: true, pageSize: 1000 }"
                                    [filterRow]="{ visible: true }" [(selectedRowKeys)]="equipmentSelected" [scrolling]="{ mode: 'infinite' }"
                                    [height]="265" [showColumnLines]="true" [showRowLines]="true" [showBorders]="true" [rowAlternationEnabled]="true">
                                    <dxo-selection [selectAllMode]="allPages" [showCheckBoxesMode]="always" mode="multiple"></dxo-selection>
                                    <dxi-column dataField="stationCode" caption="工位" [width]="100">
                                    </dxi-column>
                                    <dxi-column dataField="subArea" caption="区域" [width]="100">
                                    </dxi-column>
                                </dx-data-grid>
                            </div>
                        </dx-drop-down-box>
                    </div>
                </div>
                <div class="box-footer">
                    <button type="button" class="btn btn-primary" (click)="getReportData()"> 查 询 </button>
                </div>
            </div>
        </div>
        <div class="col-md-9 col-md-pull-3">
            <div class="box box-default">
                <div class="box-header with-border">
                    <h3 class="box-title">额定CT 配置数据</h3>
                    <div class="box-tools pull-right">
                        <button type="button" (click)="saveChanges()" class="btn btn-info btn-sm" data-toggle="tooltip"
                            title="保存">
                            <i class="fa fa-save"></i>
                        </button>
                        <button type="button" (click)="refresh()" class="btn btn-info btn-sm" data-toggle="tooltip"
                            title="刷新">
                            <i class="fa fa-refresh"></i>
                        </button>
                        <button type="button" class="btn btn-info btn-sm" data-widget="collapse">
                            <i class="fa fa-minus"></i>
                        </button>
                    </div>
                </div>
                <!-- /.box-header -->
                <div class="box-body">
                    <dx-data-grid [dataSource]="items" (onRowUpdated)="updatePartType($event)"
                        [showColumnLines]="true" [showRowLines]="true" [showBorders]="true" [rowAlternationEnabled]="true">
                        <dxo-paging [pageSize]="10"></dxo-paging>
                        <dxo-pager [showPageSizeSelector]="true" [allowedPageSizes]="[10, 20, 100]" [showInfo]="true">
                        </dxo-pager>
                        <dxo-editing mode="cell" [allowUpdating]="true">
                        </dxo-editing>
                        <dxo-filter-row [visible]="true" [applyFilter]="auto"></dxo-filter-row>
                        <dxo-editing mode="cell" [allowUpdating]="true">
                        </dxo-editing>
                        <dxi-column [allowEditing]="false" dataField="project" caption="区域">
                        </dxi-column>
                        <dxi-column [allowEditing]="false" dataField="opName" caption="工位">
                        </dxi-column>
                        <dxi-column [allowEditing]="false" dataField="partTypeId" caption="PartTypeID">
                        </dxi-column>
                        <dxi-column [allowEditing]="false" dataField="partTypeDescription" caption="型号">
                        </dxi-column>
                        <dxi-column [allowEditing]="true" dataField="description" caption="型号描述">
                        </dxi-column>
                        <dxi-column [allowEditing]="true" dataField="cleanCt" caption="额定CT">
                        </dxi-column>
                    </dx-data-grid>
                </div>
            </div>
        </div>
    </div>
</section>